package park;

public class J12SungJuk {

	public static void main(String[] args) {
		
		SungJuk tei = new SungJuk();
		SungJuk suzi = new SungJuk();
		SungJuk jihyun = new SungJuk();
		
		tei.name = "태이";
		tei.kor = 11;
		tei.eng = 22;
		tei.mat = 33;
		
		System.out.println(tei.name);
		System.out.println(tei.getTotal());
		System.out.println(tei.getAverage());
		System.out.println(tei.getGrade());
		
		suzi.name = "수지";
		suzi.kor = 44;
		suzi.eng = 55;
		suzi.mat = 66;
		
		System.out.println(suzi.name);
		System.out.println(suzi.getTotal());
		System.out.println(suzi.getAverage());
		System.out.println(suzi.getGrade());
		
		jihyun.name = "지현";
		jihyun.kor = 77;
		jihyun.eng = 88;
		jihyun.mat = 99;
		
		System.out.println(jihyun.name);
		System.out.println(jihyun.getTotal());
		System.out.println(jihyun.getAverage());
		System.out.println(jihyun.getGrade());
		

	}//메인
}//클래스

class SungJuk{
	
	String name = new String();
	int kor=0;
	int eng=0;
	int mat=0;
	int tot=0;
	double avg=0;
	char grd=' ';
	
	public int getTotal(){
		
		return kor+eng+mat;
		
	}
	
	public double getAverage(){
		
		return (double)getTotal()/3;
		
	}
	
	
	public char getGrade(){
		
		
		switch((int)getAverage()/10){
		case 10:
		case 9:grd='수';break;
		case 8:grd='우';break;
		case 7:grd='미';break;
		case 6:grd='양';break;
		default :grd='가';
			
		}
		
		return grd;
		
	}
	
}
	
	

